package com.zdsoft.blp.gongyong.myFragment;



import android.os.Bundle;


import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by pc on 2016/8/30.
 */
public abstract class CustomFragment extends Fragment {
    public View v;
    private LayoutInflater inflater;
    private ViewGroup container;

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        this.inflater=inflater;
        this.container=container;
        init();
        return v;
    }

    protected abstract void init();

    protected  void initLayout(int layoutId){
        v=inflater.inflate(layoutId,container,false);
    }

    public <T extends View> T find(int id){
        return (T)v.findViewById(id);
    }
}
